package com.ios.model.enums;

import lombok.Getter;

/**
 * 预约状态枚举
 */
@Getter
public enum ReservationStatus {
    PENDING_REVIEW(0, "待审核"),
    CANCELLED(1, "已取消"),
    REJECTED(2, "已拒绝"),
    PENDING_CHECK_IN(3, "待签到"),
    CHECKED_IN(4, "已签到"),
    NOT_CHECKED_IN(5, "未签到");

    private final int code;
    private final String description;

    ReservationStatus(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static ReservationStatus fromCode(int code) {
        for (ReservationStatus status : values()) {
            if (status.code == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid status code: " + code);
    }
}